/**
 * @Author: ls <ls-mac>
 * @Date:   2019-08-14 15:46:45
 * @Last modified by:   ls-mac
 * @Last modified time: 2019-08-15 19:04:30
 */

import request from '../utils/reqaxios';

// /admin/addOrEdit
// 管理员新增和修改
export async function adminAddOrEdit(params) {
  return request({
    url: '/admin/addOrEdit',
    method: 'post',
    data: params,
  });
}

// /admin/detail
// 管理员详情
export async function adminDetail(params) {
  return request({
    url: '/admin/detail',
    method: 'post',
    data: params,
  });
}

// /admin/page
// 管理员分页列表
export async function adminPage(params) {
  return request({
    url: '/admin/page',
    method: 'post',
    data: params,
  });
}

// /permission/list
// 权限列表
export async function permissionList(params) {
  return request({
    url: '/permission/list',
    method: 'post',
    data: params,
  });
}

// /permission/tree
// 权限树
export async function permissionTree(params) {
  return request({
    url: '/permission/tree',
    method: 'post',
    data: params,
  });
}

// /role/addOrEdit
// 角色新增和修改
export async function roleAddOrEdit(params) {
  return request({
    url: '/role/addOrEdit',
    method: 'post',
    data: params,
  });
}

// /role/delete
// 角色删除
export async function roleDelete(params) {
  return request({
    url: '/role/delete',
    method: 'post',
    data: params,
  });
}

// /role/detail
// 角色详情
export async function roleDetail(params) {
  return request({
    url: '/role/detail',
    method: 'post',
    data: params,
  });
}

// /role/list
// 角色列表
export async function roleList(params) {
  return request({
    url: '/role/list',
    method: 'post',
    data: params,
  });
}

// /role/page
// 角色列表
export async function rolePage(params) {
  return request({
    url: '/role/page',
    method: 'post',
    data: params,
  });
}

// /rolePermission
// 查询角色已分配的权限id数组
export async function rolePermission(params) {
  return request({
    url: '/rolePermission',
    method: 'post',
    data: params,
  });
}

// /rolePermission/add
// 角色权限分配
export async function rolePermissionAdd(params) {
  return request({
    url: '/rolePermission/add',
    method: 'post',
    data: params,
  });
}

// /userRole
// 查询用户已分配的角色id数组
export async function userRole(params) {
  return request({
    url: '/userRole',
    method: 'post',
    data: params,
  });
}

// /userRole/add
// 分配用户角色
export async function userRoleAdd(params) {
  return request({
    url: '/userRole/add',
    method: 'post',
    data: params,
  });
}

// /vocation/addOrEdit
// 节假日新增和修改
export async function vocationAddOrEdit(params) {
  return request({
    url: '/vocation/addOrEdit',
    method: 'post',
    data: params,
  });
}
// /vocation/delete
// 节假日删除
export async function vocationDelete(params) {
  return request({
    url: '/vocation/delete',
    method: 'post',
    data: params,
  });
}
// /vocation/detail
// 节假日详情
export async function vocationDetail(params) {
  return request({
    url: '/vocation/detail',
    method: 'post',
    data: params,
  });
}
// /vocation/page
// 节假日分页列表
export async function vocationPage(params) {
  return request({
    url: '/vocation/page',
    method: 'post',
    data: params,
  });
}
